1. Field of the Invention
The present invention relates generally to supporting transactions in in a distributed object-oriented computing environment, and more specifically to a system and method implemented in such an environment for supporting commit procedures selectively according to a single-phased commit protocol, a two-phase commit protocol, or a mixed-phase commit protocol.
2. Description of the Related Art
In a general sense a transaction in a computing environment is an exchange between one computing entity and another that accomplishes a particular action or result. For example, the entry of a customer's deposit and the updating of the customer's balance is a single transaction from the customer's point of view but involves a group of changes by an application transaction program that handles the transaction. One or more application transaction programs must interface with database files, referred to as resources, that have their own management software (resource managers) to access data and make changes to it. A procedure having specific rules, known as a commitment control protocol, ensures that a group of changes made to different database files, such as the above-referenced deposit and balance files, are synchronized so that multiple files all reflect the transaction.
It is estimated that, by the year 2000, business worth 600 billion dollars will be transacted over the Internet alone. This trend toward ever-increasing electronic commerce means that more resources will be distributed over networks globally accessible over the Internet, and continue to be spread over local area and wide area networks. Typically, in distributed computing environments, the commitment control procedure requires that each piece of transaction management software synchronize with the other transaction management software involved in the encompassing transaction taking place over the network. This synchronization ensures that data is not changed in any databases until all are in agreement that the change will be considered permanent.
The synchronization ensures the integrity of business processes and data by enforcing an "all or nothing" methodology. Each transaction is processed in its entirety, or not at all. This is sometimes referred to as atomicity. If a failure occurs during processing, the synchronization protocol will recover to the state before the request arrived, allowing the transaction to be retried if appropriate. The specific mechanism enforcing this behavior is a software component known as the transaction manager. When an application accesses multiple resources such as files, databases, and message queues, the transaction manager co-ordinates the updates to these resources, ensuring that either all updates are performed together or none are performed. It uses a method known as the two-phase commit procedure to achieve this. The two-phase commit procedure includes a voting phase in which resource manager indicates that his resource is prepared to commit, and a commit phase indicating that the data has been changed or updated. If the voting phase indicates a problem the data is not committed and the transaction does not occur.
A transaction manager component exists for each system that manages a resource along with resource management software that is responsible for managing the resource. The transaction manager is the controlling entity of the two management software entities. Not every transaction manager and resource manager has the capability to support such a two-phase commit protocol and may handle transactions using only a single-phase protocol. A single-phase protocol includes a Commit phase, and Rollback phase, but does not include a voting or Prepare phase. A peril with a single-phase commit protocol occurs if it is involved in a global transaction in a distributed environment. The single-phase system may commit its resource data to permanent storage, before another system commits, and if the other system's operation is interrupted, for example by a power outage, when it returns to a powered-on state it has data that is related to the first system's data but which is no longer in synch. In other words, the single-phase system has committed the transaction, but the two-phase system has not. Had a voting stage been implemented on both systems, the transaction would probably not have been committed because one would have been unprepared. Thus, allowing a single-phase commit protocol to be used in a distributed transaction has typically represented a degree of risk that negatively compromised data integrity, and the ability to provide ACID properties. For this reason, in a prior art distributed computing environment a resource that can be committed without the voting phase (i.e, a single-phase) is typically not allowed to participate in the transaction by the transaction management software controlling the encompassing transaction. An alternative prior art solution for handling such a situation is to eliminate the synchronization of the voting phase between resource sites, and allow each phase to operate on single-phase, but this solution carries the risk of the data being out of synch.
The above-described problem becomes even more complicated in a distributed "object-oriented" environment. Objects are becoming very popular with computer programmers because their use can greatly reduce software development time and expense. In object oriented programming, program code may be inherited from objects as long as there is an underlying system, sometimes referred to as a framework that supports the objects and allows the inheritance to take place. The object is said to encapsulate or contain properties such as certain executable code and data that is consistently reusable whenever a procedure or method is performed on the object. To ensure that they retain their properties, objects need to be saved in non-volatile locations, such as disk storage, where they are managed by resource management software, such as a relational database manager or object database manager. This is referred to as persisting the object. Thus, an advantage of objects is that one representation of an object persisted in disk memory may be used by various sites' application programs.
A disadvantage for the programmer who is concerned with ensuring the integrity of distributed transactional data involving objects, lies with the difficulty of determining what commitment procedure or protocol is supported for each object-related resource involved in the transaction before the transaction begins. In a distributed object environment, a transactional application program may not have any information regarding where objects are physically persisted. The object may be persisted on the same or different system as the application code. The software responsible for managing the object or resource may provide a commit protocol that synchronizes with other resource management software or it may not. This leads to the problem described above, where different commit protocols are being used for different resources involved in a transaction.
A solution for handling distributed transactions in which both single-phase and two-phase commit protocol support exists at different respective sites is proposed in U.S. Pat. No. 5,561,797 to Giles et al. assigned to the assignee of this invention. The solution does not offer management of object resources in an object-oriented environment, but rather focuses on a procedural database environment. In such an environment, the problem of determining where data resources can be expected to be accessed is more predictable and therefore can be managed differently than an object-oriented environment.
What is needed is a way to synchronize data in a distributed transaction environment that allows each resource requested by a transaction application program to be involved with the transaction, and which allows particular software managing a corresponding particular resource to employ its normal commitment procedure to finalize the transaction and ensure data integrity. Moreover, such a mechanism is particularly needed for distributed transactions involving distributed objects.